<template>
  <div class="app-main-container">
    <el-tabs v-model="activeTab" class="mt20">
      <el-tab-pane label="微信小程序备案" name="0"><MiniRecord v-if="activeTab === '0'" :meta="meta" @changeTab="changeTab('1')" /></el-tab-pane>
      <el-tab-pane label="备案管理" name="1"><RecordAdmin v-if="activeTab === '1'" :meta="meta" /></el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import MiniRecord from './MiniRecord.vue'
import RecordAdmin from './RecordAdmin.vue'
export default {
  name: 'RecordWeChat',
  components: {
    MiniRecord,
    RecordAdmin
  },
  data() {
    return {
      activeTab: '',
      meta: []
    }
  },
  created() {
    let activeTab = ''
    const meta = this.$route.meta.buttons || []
    if (meta.indexOf('ShopMiniProgram') > -1) {
      activeTab = '0'
    } else if (meta.indexOf('AppIcpInfoList') > -1) {
      activeTab = '1'
    }
    this.activeTab = activeTab
    this.meta = meta
  },
  methods: {
    changeTab(val) {
      this.activeTab = val
    }
  }

}
</script>

<style lang="scss" scoped>

</style>
